Scheduler should honor BuildParameters.DisableInprocNode#6400
Merged
Forgind merged 6 commits intodotnet:mainfrom Jun 4, 2021
Merged
Scheduler should honor BuildParameters.DisableInprocNode#6400Forgind merged 6 commits intodotnet:mainfrom
Forgind merged 6 commits intodotnet:mainfrom
Conversation
Member
|
The change looks good, although technically it is breaking so wondering if it shouldn't be behind a changewave. Also, this is another place where we check the env var only: Would it make sense to fix it also? |
Contributor
Author
|
@ladipro |
Member
|
rainersigwald
approved these changes
May 5, 2021
Forgind
approved these changes
May 6, 2021
rokonec
approved these changes
Jun 2, 2021
Member
rokonec
left a comment
There was a problem hiding this comment.
I suppose cleaning of
and similar would be done in another PR, am I right?
Contributor
Author
Yes, future PR after this one gets merged in. |
Otherwise the NodeManager disables the inproc node but the schedulre assigns to it which leads to build failures.
c12f1ce to
56f438f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
There are two ways in MSBuild to disable the inproc node:
MSBuildNoInprocNodeBuildParameters.DisableInprocNodeThe implementations of these two, as you'd expect from MSBuild, are totally separate, they have nothing in common. The env var informs the Scheduler to assign all requests to out of proc nodes, regardless of their affinities. And the build parameter informs the NodeManager to just bail out on inproc node creation and return null.
This means that if you set the env var and build a traversal project (dirs.proj, or a solution metaproj file), then all is fine, the scheduler silently redirects them to out of proc nodes. But if you set the build parameter instead of the env var and build the traversal dirs.proj then MSBuild fails with:
MSBUILD : error MSB4223: A node of the required type InProc could not be created.This is causing #6386 to fail some unit tests which ensure that the project cache plugin can function with the inproc node disabled: https://dev.azure.com/dnceng/public/_build/results?buildId=1114344&view=ms.vss-test-web.build-test-results-tab&runId=33953534&resultId=101506&paneView=debug
This is a bit inconsistent and I just don't see the reason for having two separate things. So I made BuildParamters.DisableInProcNode also trigger the Scheduler's ForceAffinityOutOfProc. I doubt it would break anybody, and would actually benefit the users that want to both disable the inproc node via the API (like VS does in certain cases) and avoid node creation exceptions.
Changes Made
The scheduler now forces affinity to out of proc when either the env var is set, or the build parameter is set. It will avoid build failures when the build parameter is set.
Testing
Added / updated unit tests.